package com.scorpio.common;

import com.scorpio.appuser.vo.OauthLoginVo;
import com.scorpio.common.annotation.RepeatSubmit;
import com.scorpio.core.controller.BaseController;
import com.scorpio.core.domain.Result;
import com.scorpio.framework.annotation.Log;
import com.scorpio.framework.service.LoginServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController extends BaseController {

    @Autowired
    private LoginServer loginServer;


    @RepeatSubmit
    @Log(title = "一键登录")
    @PostMapping("wxOauthLogin")
    public Result wxOauthLogin(@Validated @RequestBody OauthLoginVo vo) {
        return Result.success(loginServer.wxOauthLogin(vo));
    }

}
